home *** CD-ROM | disk | FTP | other *** search
/ Gekkan Dennou Club 142 / Gekkan Dennou Club - 2000.3 Vol. 142 (Japan).7z / Gekkan Dennou Club - 2000.3 Vol. 142 (Japan) (Track 1).bin / tools / s_tool / recode2.c < prev    next >
Text File  |  1999-06-04  |  14KB  |  668 lines

  1. #include    "JX250.H"
  2. #include    <sys\iocs.h>
  3. #include    <sys\dos.h>
  4. #include    <sys\scsi.h>
  5. #include    <stdio.h>
  6. #include    <stdlib.h>
  7.  
  8. extern    UNchar    BaiStr[][8];
  9.  
  10. UNchar    RSE[6][8]={
  11.         "CUT","PIC","GLM",
  12.         "BMP","JPG","RGB"
  13. };
  14.  
  15. /************************************************************
  16.     上 ボタンチェック
  17. [out] r= 0; 正常終了
  18.      1; キャンセル終了
  19.     99; 終了
  20. *************************************************************/
  21. int    Rec_click_botton1( ty,xx,yy )
  22. int    ty,xx,yy;
  23. {
  24. int    j,r;
  25. UNchar    buf[256];
  26. UNchar    *s;
  27. void    rcb1_sub1(),rcb1_sub2(),rcb1_sub3(),rcb1_sub4(),rcb1_sub5(),rcb1_sub6(),rcb1_sub7();
  28. r=0;
  29. switch( ty ){
  30. case('5'):
  31.     //------------- セーブ
  32.     if ( sxbotton(19*16,6*16,22*16+15,7*16+15,1)==0 ){
  33.         Rec_PosDedraw();
  34.         r=SaveGraphic();
  35.         Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  36.     }
  37.     break;
  38. case('6'):
  39.     //------------- ロード
  40.     if ( sxbotton(24*16,6*16,27*16+15,7*16+15,1)==0 ){
  41.         Rec_PosDedraw();
  42.         r=LoadGraphic();
  43.         Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  44.     }
  45.     break;
  46. case('G'):
  47.     //------------ ファイル名
  48.     r=Rec_click_name(xx);
  49.     break;
  50. case('b'):
  51.     //------------- 原点X
  52.     r++;
  53. case('a'):
  54.     r++;
  55. case('1'):
  56.     if ( ScanData==0 )    // 「画像」のポインタ
  57.         break;
  58.     if ( ty=='1' ) xx=19*16;
  59.     r=rcb1_sizesub1(r,xx,yy,RecX1,0,RecX2,rcb1_sub1);
  60.     if ( r==0 && ty=='1' )
  61.         r=Rec_click_botton1( '2',xx+80,yy );
  62.     break;
  63. case('d'):
  64.     //------------- 原点Y
  65.     r++;
  66. case('c'):
  67.     r++;
  68. case('2'):
  69.     if ( ScanData==0 )    // 「画像」のポインタ
  70.         break;
  71.     if ( ty=='2' ) xx=24*16;
  72.     r=rcb1_sizesub1(r,xx,yy,RecY1,0,RecY2,rcb1_sub2);
  73.     if ( r==0 && ty=='2' )
  74.         r=Rec_click_botton1( '3',xx-80,yy+32 );
  75.     break;
  76. case('f'):
  77.     //------------- 幅
  78.     r++;
  79. case('e'):
  80.     r++;
  81. case('3'):
  82.     if ( ScanData==0 )    // 「画像」のポインタ
  83.         break;
  84.     if ( ty=='3' ) xx=19*16;
  85.     r=rcb1_sizesub1(r,xx,yy,RecX2-RecX1,1,ScanDataX-RecX1,rcb1_sub3);
  86.     if ( r==0 && ty=='3' )
  87.         r=Rec_click_botton1( '4',xx+80,yy );
  88.     break;
  89. case('h'):
  90.     //------------- 高さ
  91.     r++;
  92. case('g'):
  93.     r++;
  94. case('4'):
  95.     if ( ScanData==0 )    // 「画像」のポインタ
  96.         break;
  97.     if ( ty=='4' ) xx=24*16;
  98.     r=rcb1_sizesub1(r,xx,yy,RecY2-RecY1,1,ScanDataY-RecY1,rcb1_sub4);
  99.     break;
  100. case('7'):
  101.     //------------- 戻る
  102.     if ( sxbotton(29*16+1,6*16+1,29*16+32-2,6*16+32-2,1)==0 )
  103.         r=99;
  104.     break;
  105. case('j'):
  106.     //------------- ドライブ
  107.     r++;
  108. case('i'):
  109.     r++;
  110.     r=rcb1_sizesub1(r,xx,yy,Drive,1,26+1,rcb1_sub5);
  111.     break;
  112. case('y'):
  113.     //------------- ソート
  114.     r++;
  115. case('x'):
  116.     r++;
  117.     r=rcb1_sizesub1(r,xx,yy,FilerSortMode,0,4,rcb1_sub6);
  118.     break;
  119. case('Z'):
  120.     //------------- JPEG セーブの設定
  121.     if ( xx<27*16+1 || xx>29*16-2 || yy<10*16 || yy>10*16+12 )
  122.         return(1);
  123.     if ( sxbotton(27*16+1,10*16,29*16-2,10*16+12,1)!=0 )
  124.         return(1);
  125.     Rec_PosDedraw();
  126.     j=DataC;
  127.     if ( ScanData==0 )
  128.         j=FullColor;
  129.     if ( j==0 && JpegedUseMode==0 ){    // 0;64k の時使用する 1;使用しない
  130.         Dialog("jpeged.r(ENCODE)のスイッ","チを設定して下さい",0,0);
  131.         s=InputStr(3*16,15*16,JpegSwc,24,0,0);
  132.         if ( s[0]==0 && s[1]==255 ){
  133.             r=1;
  134.         } else {
  135.             strcpy(JpegSwc,s);
  136.             r=0;
  137.         }
  138.         Dialog(0,0,0,-1);
  139.     } else {
  140.         Dialog("ej.x(ENCODE)のスイッチを","設定して下さい",0,0);
  141.         s=InputStr(3*16,15*16,Jpeg24Swc,24,0,0);
  142.         if ( s[0]==0 && s[1]==255 ){
  143.             r=1;
  144.         } else {
  145.             strcpy(Jpeg24Swc,s);
  146.             r=0;
  147.         }
  148.         Dialog(0,0,0,-1);
  149.         Dialog("ej.x/dj.x の テンポラリパス","設定して下さい(省略可)",0,0);
  150.         s=InputStr(3*16,15*16,RGBtemp,24,0,0);
  151.         if ( s[0]==0 && s[1]==255 ){
  152.             r=1;
  153.         } else {
  154.             strcpy(RGBtemp,s);
  155.             r=0;
  156.         }
  157.         Dialog(0,0,0,-1);
  158.     }
  159.     Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  160.     break;
  161. default:
  162.     if ( ty>='A' && ty<='F' ){
  163.         RecSavMode=ty-'A';
  164.         Rec_SaveModeDraw();
  165.         if ( Afile[0]!=0 ){
  166.             jstrcpy(buf,Afile);
  167.             strmfe(Afile,buf,RSE[RecSavMode]);
  168.         }
  169.         FileSearch(0);
  170.         ViewFiles(-1);
  171.         ViewFiles(ViewFileY);
  172.     }
  173. }
  174. return(r);
  175. }
  176. /*************************************
  177.     (上)上部サブルーチン
  178. *************************************/
  179. int    rcb1_sizesub1(ty,xx,yy,ii,ll,hh,sub)
  180. int    ty,xx,yy,ii,hh,ll;
  181. void    (*sub)();
  182. {
  183. int    i,r;
  184. UNchar    *M;
  185. UNchar    buf[128];
  186. if ( ty==0 ){
  187.     sprintf(buf,"%d",ii);        //sprintf(buf,"%5d",i);
  188.     M=InputStr((xx&0xFFF0)+2,(yy&0xFFF0)+2,buf,5,0,1);
  189.     if ( M[0]==0 && M[1]==0xFF ){
  190.         Rec_PosSetDraw(-1,-1,-1,-1,-1);
  191.         r=1;
  192.     } else {
  193.         i=atoi(M);
  194.         if ( i<ll || i>=hh ){
  195.             Rec_PosSetDraw(-1,-1,-1,-1,-1);
  196.             r=1;
  197.         } else {
  198.             (*sub)(i);
  199.             r=0;
  200.         }
  201.     }
  202. } else {
  203.     r=kazu_move(((ty==1)?xx:xx-16)&0xFFF0,yy&0xFFF0,0,ii,ll,hh-1,sub);
  204. }
  205. return(r);
  206. }
  207. /*+++++++++++++++++++++++++++++++*/
  208. void    rcb1_sub1(int l)
  209. {
  210. int    i;
  211. i=RecX2+(l-RecX1);
  212. if ( i>=ScanDataX )
  213.     i=ScanDataX;
  214. Rec_PosSetDraw(l,RecY1,i,RecY2);
  215. }
  216. /*++++++++++*/
  217. void    rcb1_sub2(int l)
  218. {
  219. int    i;
  220. i=RecY2+(l-RecY1);
  221. if ( i>=ScanDataY )
  222.     i=ScanDataY;
  223. Rec_PosSetDraw(RecX1,l,RecX2,i);
  224. }
  225. /*++++++++++*/
  226. void    rcb1_sub3(int l)
  227. {
  228. Rec_PosSetDraw(RecX1,RecY1,RecX1+l,RecY2);
  229. }
  230. /*++++++++++*/
  231. void    rcb1_sub4(int l)
  232. {
  233. Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY1+l);
  234. }
  235. /*++++++++++*/
  236. void    rcb1_sub5(int l)
  237. {
  238. int    o;
  239. o=Drive;
  240. ChDrvDir(Apath);
  241. Drive= l;
  242. GetDrvDir(l,Apath);
  243. FileSearch(0);
  244. Drive= l;
  245. ViewFiles(-1);
  246. ViewFiles(ViewFileY);
  247. }
  248. /*++++++++++*/
  249. void    rcb1_sub6(int l)
  250. {
  251. FilerSortMode=l;
  252. Rec_SortModeDraw();
  253. FileSearch(0);
  254. ViewFiles(-1);
  255. ViewFiles(ViewFileY);
  256. }
  257. /************************************************************
  258.     倍率ボタンチェック
  259. [out] r= 0; 正常終了
  260.      1; キャンセル終了
  261.     99; 終了
  262. *************************************************************/
  263. int    Rec_click_botton4( xx )
  264. int    xx;
  265. {
  266. int    r;
  267. void    rcb4_sub();
  268. r=kazu_move(13*16,0,0,RecVwBai,-3,2,rcb4_sub);        // x4 までにしておこう
  269. return(r);
  270. }
  271. /*++++++++++*/
  272. void    rcb4_sub(int l)
  273. {
  274. int    i;
  275. RecVwBai=l;
  276. if ( l>=0 ){
  277.     i=1<<RecVwBai;
  278.     if ( RecPX>(ScanDataX-(256/i)) )
  279.         RecPX=ScanDataX-(256/i);
  280.     if ( RecPY>(ScanDataY-(480/i)) )
  281.         RecPY=ScanDataY-(480/i);
  282. } else {
  283.     i=1<<(-RecVwBai);
  284.     if ( RecPX>(ScanDataX-(256*i)) )
  285.         RecPX=ScanDataX-(256*i);
  286.     if ( RecPY>(ScanDataY-(480*i)) )
  287.         RecPY=ScanDataY-(480*i);
  288. }
  289. if ( RecPX<0 )
  290.     RecPX=0;
  291. if ( RecPY<0 )
  292.     RecPY=0;
  293. Rec_PosDedraw();
  294. ScanGraphView(RecPX,RecPY,0);
  295. Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  296. p_12_sprintf(11*16+2+6,2,BaiStr[ RecVwBai+4 ]);
  297. }
  298. /************************************************************
  299.     縦バー(ボタン)
  300. [out] r= 0; 正常終了
  301.      1; キャンセル終了
  302.     99; 終了
  303. *************************************************************/
  304. int    Rec_click_botton6( yy,bt )
  305. int    yy,bt;
  306. {
  307. int    i,j,r,yo,sy,b,y,bi,py;
  308. void    rcb6_sub1();
  309. if ( bt==0 ){
  310.     j=( yy==1 )?1:2;
  311.     if ( RecVwBai>=0 ){
  312.         i=1<<RecVwBai;
  313.         r=kazu_move(0,yy*16,j,RecPY/8,0,(ScanDataY/8-(480/8/i))+1,rcb6_sub1);
  314.     } else {
  315.         i=1<<(-RecVwBai);
  316.         r=kazu_move(0,yy*16,j,RecPY/8,0,(ScanDataY/8-(480/8*i))+1,rcb6_sub1);
  317.     }
  318. } else {
  319.     if ( RecVwBai>=0 ){
  320.         bi=1<<RecVwBai;
  321.         j=RecPY *(30*16-32)/ScanDataY +32 ;
  322.         i=480/bi *(30*16-32)/ScanDataY +j;
  323.     } else {
  324.         bi=1<<(-RecVwBai);
  325.         j=RecPY *(30*16-32)/ScanDataY +32 ;
  326.         i=480*bi *(30*16-32)/ScanDataY +j;
  327.     }
  328.     if ( yy<j || yy>i )
  329.         return(0);
  330.     yo=-1;
  331.     sy=yy;
  332.     py=RecPY;
  333.     while( MS_LSW()!=0 && (b=MS_RSW())==0 ){
  334.         yy=( i=_ms_curgt_() )&0xFFFF;
  335.         if ( yo==yy )
  336.             continue;
  337.         yo=yy;
  338.         y=(yy-sy)*ScanDataY/(30*16-32);
  339.         j=py+y;
  340.         if ( RecVwBai>=0 ){
  341.             if ( j>=(ScanDataY-(480/bi)) )
  342.                 j=(ScanDataY-(480/bi))-1 +1;
  343.         } else {
  344.             if ( j>=(ScanDataY-(480*bi)) )
  345.                 j=(ScanDataY-(480*bi))-1 +1;
  346.         }
  347.         if ( j<0 )
  348.             j=0;
  349.         if ( RecPY!=j ){
  350.             RecPY=j;
  351.             Rec_PosDedraw();
  352.             ScanGraphView(RecPX,RecPY,0);
  353.             Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  354.             CRTVDISP();
  355.         }
  356.     }
  357.     r=0;
  358. }
  359. return(r);
  360. }
  361. /*++++++++++*/
  362. void    rcb6_sub1(int l)
  363. {
  364. int    i;
  365. PosDedraw();
  366. RecPY=l*8;
  367. if ( RecVwBai>=0 ){
  368.     i=1<<RecVwBai;
  369.     if ( RecPY>=(ScanDataY-(480/i)) )
  370.         RecPY=(ScanDataY-(480/i))-1 +1;
  371.     if ( RecPY<0 )
  372.         RecPY=0;
  373. } else {
  374.     i=1<<(-RecVwBai);
  375.     if ( RecPY>=(ScanDataY-(480*i)) )
  376.         RecPY=(ScanDataY-(480*i))-1 +1;
  377.     if ( RecPY<0 )
  378.         RecPY=0;
  379. }
  380. ScanGraphView(RecPX,RecPY,0);
  381. Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  382. }
  383. /************************************************************
  384.     横バーボタン
  385. [out] r= 0; 正常終了
  386.      1; キャンセル終了
  387.     99; 終了
  388. *************************************************************/
  389. int    Rec_click_botton7( xx,bt )
  390. int    xx,bt;
  391. {
  392. int    i,j,r,xo,sx,b,x,bi,yy,px;
  393. void    rcb7_sub1();
  394. if ( bt==0 ){
  395.     j=( xx==1 )?1:2;
  396.     if ( RecVwBai>=0 ){
  397.         i=1<<RecVwBai;
  398.         r=kazu_move(xx*16,31*16,j,RecPX/8,0,(ScanDataX/8-(256/8/i))+1,rcb7_sub1);
  399.     } else {
  400.         i=1<<(-RecVwBai);
  401.         r=kazu_move(xx*16,31*16,j,RecPX/8,0,(ScanDataX/8-(256/8*i))+1,rcb7_sub1);
  402.     }
  403. } else {
  404.     if ( RecVwBai>=0 ){
  405.         bi=1<<RecVwBai;
  406.         j=RecPX *(15*16-32)/ScanDataX +32 ;
  407.         i=256/bi *(15*16-32)/ScanDataX +j;
  408.     } else {
  409.         bi=1<<(-RecVwBai);
  410.         j=RecPX *(15*16-32)/ScanDataX +32 ;
  411.         i=256*bi *(15*16-32)/ScanDataX +j;
  412.     }
  413.     if ( xx<j || xx>i )
  414.         return(0);
  415.     xo=-1;
  416.     sx=xx;
  417.     px=RecPX;
  418.     while( MS_LSW()!=0 && (b=MS_RSW())==0 ){
  419.         yy=( i=_ms_curgt_() )&0xFFFF;
  420.         xx=i>>16;
  421.         if ( xo==xx )
  422.             continue;
  423.         xo=xx;
  424.         x=(xx-sx)*ScanDataX/(15*16-32);
  425.         j=px+x;
  426.         if ( RecVwBai>=0 ){
  427.             if ( j>=(ScanDataX-(256/bi)) )
  428.                 j=(ScanDataX-(256/bi))-1 +1;
  429.         } else {
  430.             if ( j>=(ScanDataX-(256*bi)) )
  431.                 j=(ScanDataX-(256*bi))-1 +1;
  432.         }
  433.         if ( j<0 )
  434.             j=0;
  435.         if ( RecPX!=j ){
  436.             RecPX=j;
  437.             Rec_PosDedraw();
  438.             ScanGraphView(RecPX,RecPY,0);
  439.             Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  440.             CRTVDISP();
  441.         }
  442.     }
  443.     r=0;
  444. }
  445. return(r);
  446. }
  447. /*++++++++++*/
  448. void    rcb7_sub1(int l)
  449. {
  450. int    i;
  451. PosDedraw();
  452. RecPX=l*8;
  453. if ( RecVwBai>=0 ){
  454.     i=1<<RecVwBai;
  455.     if ( RecPX>=(ScanDataX-(256/i)) )
  456.         RecPX=(ScanDataX-(256/i))-1  +1;
  457.     if ( RecPX<0 )
  458.         RecPX=0;
  459. } else {
  460.     i=1<<(-RecVwBai);
  461.     if ( RecPX>=(ScanDataX-(256*i)) )
  462.         RecPX=(ScanDataX-(256*i))-1  +1;
  463.     if ( RecPX<0 )
  464.         RecPX=0;
  465. }
  466. ScanGraphView(RecPX,RecPY,0);
  467. Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  468. }
  469. /************************************************************
  470.     縦横バー
  471. [out] r= 0; 正常終了
  472.      1; キャンセル終了
  473.     99; 終了
  474. *************************************************************/
  475. int    Rec_click_bar( xx,yy )
  476. int    xx,yy;
  477. {
  478. int    i,j,r,xo,yo,sx,sy,x,y,bi,px,py;
  479. xo=-1;
  480. yo=-1;
  481. sx=xx;
  482. sy=yy;
  483. px=RecPX;
  484. py=RecPY;
  485. if ( RecVwBai>=0 ){
  486.     bi=1<<RecVwBai;
  487. } else {
  488.     bi=1<<(-RecVwBai);
  489. }
  490. MsPat(7);
  491. while( MS_RSW()!=0 ){
  492.     _dos_keysns();
  493.     _dos_change_pr();
  494.     yy=( i=_ms_curgt_() )&0xFFFF;
  495.     xx=i>>16;
  496.     if ( xo==xx && yo==yy )
  497.         continue;
  498.     xo=xx;
  499.     yo=yy;
  500.     if ( RecVwBai>=0 ){
  501.         x=(xx-sx)/bi;
  502.         y=(yy-sy)/bi;
  503.     } else {
  504.         x=(xx-sx)*bi;
  505.         y=(yy-sy)*bi;
  506.     }
  507.     i=px-x;
  508.     if ( RecVwBai>=0 ){
  509.         if ( i>=(ScanDataX-(256/bi)) )
  510.             i=(ScanDataX-(256/bi))-1 +1;
  511.     } else {
  512.         if ( i>=(ScanDataX-(256*bi)) )
  513.             i=(ScanDataX-(256*bi))-1 +1;
  514.     }
  515.     if ( i<0 )
  516.         i=0;
  517.     j=py-y;
  518.     if ( RecVwBai>=0 ){
  519.         if ( j>=(ScanDataY-(480/bi)) )
  520.             j=(ScanDataY-(480/bi))-1 +1;
  521.     } else {
  522.         if ( j>=(ScanDataY-(480*bi)) )
  523.             j=(ScanDataY-(480*bi))-1 +1;
  524.     }
  525.     if ( j<0 )
  526.         j=0;
  527.     if ( RecPX!=i || RecPY!=j ){
  528.         RecPX=i;
  529.         RecPY=j;
  530.         Rec_PosDedraw();
  531.         ScanGraphView(RecPX,RecPY,0);
  532.         Rec_PosSetDraw(RecX1,RecY1,RecX2,RecY2);
  533.         CRTVDISP();
  534.     }
  535. }
  536. MsPat(0);
  537. r=0;
  538. return(r);
  539. }
  540. /************************************************************
  541.     FILES
  542. [out] r= 0; 正常終了
  543.      1; キャンセル終了
  544.     99; 終了
  545. *************************************************************/
  546. int    Rec_click_files( yy )
  547. int    yy;
  548. {
  549. int    y;
  550. UNchar    buf[256];
  551. y=ViewFileY+yy;
  552. if ( DDS_max<0 )
  553.     return(1);
  554. if ( y>=DDS_max )
  555.     return(1);
  556. if ( (DDS[y].atr&bit(4))!=0 ){
  557.     // ディレクトリだ
  558.     jstrcpyfnm(buf,DDS[y].fname,DDS[y].fext);
  559.     _dos_chdir( buf );
  560.     GetDrvDir(0,Apath);
  561.     FileSearch(0);
  562.     ViewFiles(-1);
  563.     ViewFiles(ViewFileY);
  564. } else {
  565.     jstrcpyfnm(Afile,DDS[y].fname,DDS[y].fext);
  566.     ViewFiles(-1);
  567.     //ViewFiles(ViewFileY);
  568. }
  569. return(0);
  570. }
  571. /************************************************************
  572.     なまえ
  573. [out] r= 0; 正常終了
  574.      1; キャンセル終了
  575.     99; 終了
  576. *************************************************************/
  577. int    Rec_click_name(xx)
  578. int    xx;
  579. {
  580. int    r;
  581. UNchar    dummy[128];
  582. UNchar    name[128];
  583. UNchar    *M;
  584. M=InputStr(19*16+2,11*16+2,Afile,26,0,0);
  585. if ( M[0]==0 && M[1]==0xFF ){
  586.     ViewFiles(-1);
  587.     r=1;
  588. } else {
  589.     strsfn(M,dummy,dummy,name,dummy);
  590.     strmfe(Afile,name,RSE[RecSavMode]);
  591.     ViewFiles(-1);
  592.     r=0;
  593. }
  594. return(r);
  595. }
  596. /************************************************************
  597.     files スクロール
  598. [out] r= 0; 正常終了
  599.      1; キャンセル終了
  600.     99; 終了
  601. *************************************************************/
  602. int    Rec_click_roll( yy )
  603. int    yy;
  604. {
  605. int    i,m,y,o;
  606. m=DDS_max-16;
  607. //if ( yy==8 )
  608. //    return(0);
  609. y=yy/4;
  610. i=0;
  611. if ( sxbotton(30*16,i+14*16+y*(16*4),30*16+15,i+14*16+y*(16*4)+16*4-1,1)!=0 ){
  612.     // Cansel
  613.     return(1);
  614. }
  615. if ( m<=0 )
  616.     return(0);
  617. o=ViewFileY;
  618. if ( y<=1 ){
  619.     // 上
  620.     if ( y==0 )
  621.         ViewFileY-=8;
  622.     else    ViewFileY--;
  623.     if ( ViewFileY<0 )
  624.         ViewFileY=0;
  625. } else {
  626.     // 下
  627.     if ( y==3 )
  628.         ViewFileY+=8;
  629.     else    ViewFileY++;
  630.     if ( ViewFileY>m )
  631.         ViewFileY=m;
  632. }
  633. if ( o!=ViewFileY )
  634.     ViewFiles(ViewFileY);
  635. return(0);
  636. }
  637. /************************************************************
  638.     [DEL]ボタン
  639. [out] r= 0; 正常終
  640.      1; キャンセル終了
  641.     99; 終了
  642. *************************************************************/
  643. int    Rec_click_del()
  644. {
  645. int    f;
  646. if ( sxbotton(27*16,30*16,29*16,31*16-1,-1)!=0 )
  647.     return(1);
  648. if ( Afile[0]==0 ){
  649.     Dialog(0,"ファイル名を指定して下さい",0,1);
  650.     return(1);
  651. }
  652. f=_dos_open(Afile,0);
  653. if ( f<0 ){
  654.     Dialog(0,"指定ファイルは","存在していません",1);
  655.     return(1);
  656. }
  657. // ファイルが open できた
  658. _dos_close(f);
  659. if ( Dialog(0,"指定ファイルを消去して","よろしいですか?",2)!=0 )
  660.     return(1);
  661. _dos_delete(Afile);
  662. FileSearch(0);
  663. ViewFiles(-1);
  664. ViewFiles(ViewFileY);
  665. return(0);
  666. }
  667.  
  668.